package com.gl.glcourses.quartz;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.scheduling.quartz.QuartzJobBean;

import com.gl.glcourses.services.IFeedbackServices;
import com.gl.glcourses.services.IParticipanteServices;
import com.gl.glcourses.services.IStaticServices;
import com.gl.glcourses.services.IUsuarioServices;
import com.gl.glcourses.services.IVotacionServices;

@Configurable(preConstruction=true)
public class RunMeJob extends QuartzJobBean{
	
	@Autowired
	IUsuarioServices usuarioServices;
	
	@Autowired
	IParticipanteServices participanteServices;

	@Autowired
	IVotacionServices votacionServices;
	
	@Autowired
	IStaticServices staticServices;
	@Autowired
	IFeedbackServices feedbackServices;

	public IParticipanteServices getParticipanteServices() {
		return participanteServices;
	}
	
	public void setParticipanteServices(IParticipanteServices participanteServices) {
		this.participanteServices = participanteServices;
	}
	
	public IStaticServices getStaticServices() {
		return staticServices;
	}

	public void setStaticServices(IStaticServices staticServices) {
		this.staticServices = staticServices;
	}
	public IUsuarioServices getUsuarioServices() {
		return usuarioServices;
	}

	public void setUsuarioServices(IUsuarioServices usuarioServices) {
		this.usuarioServices = usuarioServices;
	}

	public IVotacionServices getVotacionServices() {
		return votacionServices;
	}

	public void setVotacionServices(IVotacionServices votacionServices) {
		this.votacionServices = votacionServices;
	}

	public IFeedbackServices getFeedbackServices() {
		return feedbackServices;
	}

	public void setFeedbackServices(IFeedbackServices feedbackServices) {
		this.feedbackServices = feedbackServices;
	}

	@Override
	protected void executeInternal(JobExecutionContext context)
			throws JobExecutionException {	
		
		//usuarioServices.updateNewUsers();
		//usuarioServices.notificacionUsuariosSinOficina();
			try {
			//	participanteServices.avisoAprobacionesPendientes();
			//	votacionServices.notificacionRecordatorioVotar();
			//	staticServices.updateStaticHorasOficina();
			//	staticServices.updateTopTenCursos();
			//	feedbackServices.notificacionRealizarFeedback();
				
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

		
	}

}
